<?php
require __DIR__.'/vendor/autoload.php';

$vendor_dir = __DIR__.'/vendor';
$src_dir = __DIR__.'/src';
$config_dir = __DIR__.'/config';
$config_files = array(
    'database' => 'database.php',
    'app' => 'app.php',
);
$cache_dir = __DIR__.'/cache';
$logs_dir = __DIR__.'/logs';

// Configuration initialization
use Doctrine\Common\Collections\ArrayCollection;
$config = array();
foreach($config_files as $key => $config_file)
{
    $temp_config = include($config_dir.'/'.$config_file);
    $config[$key] = new ArrayCollection($temp_config);
}
$config['dir'] = new ArrayCollection(array(
    'vendor' => $vendor_dir,
    'src' => $src_dir,
    'config' => $config_dir,
    'logs' => $logs_dir,
    'cache' => $cache_dir,
));


$config = new ArrayCollection($config);
App\Globals::init()->setConfig($config);


include(__DIR__.'/doctrine.bootstrap.php');